﻿using System;
using eCommerce.Core.Domain.Addresses;

namespace eCommerce.Models.Commons
{
    public class AddressModel
    {

        public virtual int CustomerId { get; set; }
        public virtual int Id { get; set; }
        public virtual string Email { get; set; }

        public virtual string FirstName { get; set; }

        public virtual string LastName { get; set; }


        public virtual string Province { get; set; }

        public virtual string City { get; set; }

        public virtual string Region { get; set; }

        public virtual string Address1 { get; set; }
        public virtual string Address2 { get; set; }

        public virtual string ZipPostalCode { get; set; }


        public virtual string MobileNumber { get; set; }


        public virtual string PhoneNumber { get; set; }


        public virtual DateTime CreatedOnUtc { get; set; }


     
        public void PrepareModel(Address address)
        {
            if ( address != null)
            {
                this.Id = address.Id;
                this.FirstName = address.FirstName;
                this.LastName = address.LastName;
                this.Email = address.Email;

                this.Province= address.Province;
                this.City = address.City;
                this.Region = address.Region;
                this.Address1 = address.Address1;
                this.Address2 = address.Address2;
                this.ZipPostalCode = address.ZipPostalCode;
                this.PhoneNumber = address.PhoneNumber;
                this.MobileNumber = address.MobileNumber;
            }
        }

        public void PrepareNewModel()
        {
        }
    }
}